<template>
	<view class="indexbanner">
		<swiper class="swiper" circular  :autoplay="autoplay" :interval="interval"
			:duration="duration">
			<swiper-item v-for="(item,index) in list">
				<view class="swiper-item ">
					<image class="banner"  :src="item.img"></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list  : [],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500
			}
		},
		created() {
			let that  = this;
			that.$api.getBanner({}).then(res=>{
				that.list = res.data.list;
				console.log(res);
			})
		},
		methods: {
			changeIndicatorDots(e) {
				this.indicatorDots = !this.indicatorDots
			},
			changeAutoplay(e) {
				this.autoplay = !this.autoplay
			},
			intervalChange(e) {
				this.interval = e.target.value
			},
			durationChange(e) {
				this.duration = e.target.value
			}
		}
	}
</script>

<style>
	.swiper {
		height: 460rpx;
	}
	.banner {
		width: 700rpx;
		height: 380rpx;
		display: block;
		margin: auto;
		position: relative;
		top: 40rpx;
		border-radius: 30rpx;
		/* margin-top: 80rpx; */
	}
</style>